#pragma once
#include <iostream>
#include <string>
#include <sstream>
#include <random>
#include <chrono>

// Function to generate a unique session_id
std::string generateSessionId() {
    // Seed with current time and random number
    unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
    std::mt19937 generator(seed);
    std::uniform_int_distribution<int> distribution(0, 15); // Hex digits range

    // Generate a random hexadecimal string of length 16
    std::stringstream ss;
    ss << std::hex << std::uppercase;
    for (int i = 0; i < 16; ++i) {
        int randomHex = distribution(generator);
        ss << (randomHex < 10 ? char('0' + randomHex) : char('A' + (randomHex - 10)));
    }

    return ss.str();
}